#! /bin/bash
export LANG=zh_CN.UTF-8
PRESTO_HOME=/export/server/presto/bin/presto


${PRESTO_HOME} --catalog hive --server 192.168.88.80:8090 --execute "
-- 班级在读学生人数表
insert into hive.edu_online_dwd.dim_class_studying_student_count
select
    id,
    school_id,
    subject_id,
    class_id,
    studying_student_count,
    studying_date
from hive.edu_online_ods.class_studying_student_count;

-- 班级课表
insert into hive.edu_online_dwd.dim_course_table_upload_detail
select
    id,
    base_id,
    class_id,
    class_date,
    content,
    teacher_id,
    teacher_name,
    job_number,
    classroom_id,
    classroom_name,
    is_outline,
    class_mode,
    is_stage_exam,
    is_pay,
    tutor_teacher_id,
    tutor_teacher_name,
    tutor_job_number,
    is_subsidy,
    answer_teacher_id,
    answer_teacher_name,
    answer_job_number,
    remark,
    create_time
from hive.edu_online_ods.course_table_upload_detail;

-- 班级作息时间表
insert into hive.edu_online_dwd.dim_tbh_class_time_table
select
    id,
    class_id,
    morning_template_id,
    morning_begin_time,
    morning_end_time,
    afternoon_template_id,
    afternoon_begin_time,
    afternoon_end_time,
    evening_template_id,
    evening_begin_time,
    evening_end_time,
    use_begin_date,
    use_end_date,
    create_time,
    create_person,
    remark
from hive.edu_online_ods.tbh_class_time_table;"